<?php
class Webmix_Form_Block_Edit extends Engine_Form
{
    
    protected $block_id = 0;
    protected $webmix_id = 0;
    public function setBlock($id){
        $this->block_id = $id;    
    }
    public function setWebmix($id){
        $this->webmix_id = $id;    
    }    
  public function init()
  {
      //get view  
      $view = Zend_Registry::get('Zend_View');
      
      $this->clearDecorators()
      ->setAction(Zend_Controller_Front::getInstance()->getRouter()->assemble(array()));

        $this->setTitle('Edit Block');
        $this->setAction($view->url(array('module'=>'webmix','controller'=>'block','action'=>'edit','format'=>'smoothbox','webmix'=>$this->webmix_id,'block'=>$this->block_id),'default'));
        $this->addElement('text','title',array(
            'label'=>'Company name or Link',
			'required' =>true,
            'allowEmtry'=>false,
            'validators' => array (
					array (
						'NotEmpty', 
						true
					)
			)                                             
        ));   
    
       $this->addElement('Hidden', 'comp_id', array('order' => 101)); 
       $this->addElement('Hidden', 'action_type', array('order' => 102));      
       
       	$this->addElement('Button', 'submit', array (
			'label' => 'Save', 
			'type' => 'submit',
			'decorators' => array (
				'ViewHelper'
			)
		)); 
       
		$this->addElement('Cancel', 'cancel', array (
				'label' => 'cancel', 
				'link' => true, 
				'href' => '', 
                'onclick' => 'parent.Smoothbox.close();',
				'decorators' => array (
						'ViewHelper'
				)
		));          

		$this->addDisplayGroup(
			array (
				'submit', 
				'cancel'
			), 'buttons', array ()
		);            
  }
}